package com.flycent.fanbao.adapter;

import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public abstract class FakeCirculatePagerAdapter extends FragmentPagerAdapter {

	public FakeCirculatePagerAdapter(FragmentManager fm) {
		super(fm);
	}

	@Override
	public int getCount() {
		int realCount = getRealCount();
		return realCount > 1 ? Integer.MAX_VALUE : realCount;
	}
	
	public abstract int getRealCount();
	
	/**
	 * 根据当前position 得到真实的 position
	 * @param position
	 * @return position %  getRealCount()
	 */
	public int getRealPosition(int position) {
		return position % getRealCount();
	}

}
